<?php

namespace App\Http\Requests\OperationManagement;

use Illuminate\Foundation\Http\FormRequest;
use App\Http\Requests\BaseRequest;

class TrashSiteRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'address' => 'required',
            'type' => 'required|integer',
            'mold' => 'required|integer',
            // 'number' => 'required|integer',
            'bulk' => 'required',
            'clean_num' => 'required|integer',
            'path' => 'required|integer',
            'clean_time' => 'required',
            'bulk_avg' => 'required'
        ];
    }

    public function messages() 
    {
        return [
            'name.required' => '垃圾点位不能为空',
            'address.required' => '详细地址不能为空',
            'type.required' => '垃圾类型不能为空',
            'type.integer' => '垃圾类型只能填写数字',
            'mold.required' => '容器类型不能为空',
            'mold.integer' => '容器类型只能填写数字',
            'number.required' => '总数量不能为空',
            'number.integer' => '总数量只能填写数字',
            'bulk.required' => '总容积不能为空',
            'clean_num.required' => '日清运次数不能为空',
            'clean_num.integer' => '日清运次数只能填写数字',
            'path.required' => '路线不能为空',
            'path.integer' => '路线只能填写数字',
            'clean_time.required' => '清运时间范围不能为空',
            'bulk_avg.required' => '日均垃圾容量不能为空'
        ];
    }
}
